package com.coolingme.player;

import java.util.ArrayList;
import java.util.List;

/**
 * 命令控制器
 *
 * @author wangyue
 * @date 2020-09-24 21:40
 */
public class ActionController {

    /**
     * 命令批量处理容器
     */
    private List<IAction> actionList = new ArrayList<>();

    /**
     * 添加命名
     *
     * @param action IAction
     */
    public void addAction(IAction action) {
        actionList.add(action);
    }

    /**
     * 批量处理
     */
    public void executeBatch() {
        for (IAction action : actionList) {
            action.execute();
        }
    }

    /**
     * 处理单个命令
     */
    public void execute(IAction action) {
        action.execute();
    }

}
